<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		圆的半径:<input type="text" id="input1" />
		<button onclick="calc()">计算</button>
		
		<script>
			
			console.log("π="+Math.PI);
			
			function calc()
			{
				var r=parseFloat(input1.value)
				var area.=Math.PI * r * r;
				alert("圆的面积:"+area);
			}
		</script>
	</body>
</html>
